Propagate the focus-on-click value to the button. (#310543, Christian
authorMatthias Clasen <mclasen@redhat.com>
Mon, 18 Jul 2005 14:47:55 +0000 (14:47 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Mon, 18 Jul 2005 14:47:55 +0000 (14:47 +0000)
2005-07-18  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkcombobox.c (gtk_combo_box_set_focus_on_click): Propagate
the focus-on-click value to the button.  (#310543, Christian Persch)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-8
gtk/gtkcombobox.c

index e33e6552accbc419e8582c43a08fce0ab257b6f7..f18797c16039b2f186cf32f3ffef0434a868b99d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2005-07-18  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkcombobox.c (gtk_combo_box_set_focus_on_click): Propagate
+       the focus-on-click value to the button.  (#310543, Christian Persch)
+
        * gtk/gtkwidget.c (gtk_widget_set_double_buffered): Add a note
        about the need to handle expose events. We really need a chapter
        on the GTK+ drawing model that we can refer to here... (#310765,
index e33e6552accbc419e8582c43a08fce0ab257b6f7..f18797c16039b2f186cf32f3ffef0434a868b99d 100644 (file)
@@ -1,5 +1,8 @@
 2005-07-18  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkcombobox.c (gtk_combo_box_set_focus_on_click): Propagate
+       the focus-on-click value to the button.  (#310543, Christian Persch)
+
        * gtk/gtkwidget.c (gtk_widget_set_double_buffered): Add a note
        about the need to handle expose events. We really need a chapter
        on the GTK+ drawing model that we can refer to here... (#310765,
index e33e6552accbc419e8582c43a08fce0ab257b6f7..f18797c16039b2f186cf32f3ffef0434a868b99d 100644 (file)
@@ -1,5 +1,8 @@
 2005-07-18  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkcombobox.c (gtk_combo_box_set_focus_on_click): Propagate
+       the focus-on-click value to the button.  (#310543, Christian Persch)
+
        * gtk/gtkwidget.c (gtk_widget_set_double_buffered): Add a note
        about the need to handle expose events. We really need a chapter
        on the GTK+ drawing model that we can refer to here... (#310765,
index 3147d7591456a6fd4614cdc0ead24096306883a5..8df90b9b1b29606171d7c0bd806404ea26a8d398 100644 (file)
@@ -775,7 +775,8 @@ gtk_combo_box_set_property (GObject      *object,
         break;
 
       case PROP_FOCUS_ON_CLICK:
-        combo_box->priv->focus_on_click = g_value_get_boolean (value);
+       gtk_combo_box_set_focus_on_click (combo_box, 
+                                         g_value_get_boolean (value));
         break;
 
       default:
@@ -2389,6 +2390,8 @@ gtk_combo_box_menu_setup (GtkComboBox *combo_box,
   if (combo_box->priv->cell_view)
     {
       combo_box->priv->button = gtk_toggle_button_new ();
+      gtk_button_set_focus_on_click (GTK_BUTTON (combo_box->priv->button),
+                                    combo_box->priv->focus_on_click);
 
       g_signal_connect (combo_box->priv->button, "toggled",
                         G_CALLBACK (gtk_combo_box_button_toggled), combo_box);
@@ -2415,6 +2418,9 @@ gtk_combo_box_menu_setup (GtkComboBox *combo_box,
   else
     {
       combo_box->priv->button = gtk_toggle_button_new ();
+      gtk_button_set_focus_on_click (GTK_BUTTON (combo_box->priv->button),
+                                    combo_box->priv->focus_on_click);
+
       g_signal_connect (combo_box->priv->button, "toggled",
                         G_CALLBACK (gtk_combo_box_button_toggled), combo_box);
       g_signal_connect_after (combo_box, "key_press_event",
@@ -5148,18 +5154,22 @@ gtk_combo_box_set_row_separator_func (GtkComboBox                 *combo_box,
  * Since: 2.6
  **/
 void
-gtk_combo_box_set_focus_on_click (GtkComboBox *combo,
+gtk_combo_box_set_focus_on_click (GtkComboBox *combo_box,
                                  gboolean     focus_on_click)
 {
-  g_return_if_fail (GTK_IS_COMBO_BOX (combo));
+  g_return_if_fail (GTK_IS_COMBO_BOX (combo_box));
   
   focus_on_click = focus_on_click != FALSE;
 
-  if (combo->priv->focus_on_click != focus_on_click)
+  if (combo_box->priv->focus_on_click != focus_on_click)
     {
-      combo->priv->focus_on_click = focus_on_click;
+      combo_box->priv->focus_on_click = focus_on_click;
+
+      if (combo_box->priv->button)
+       gtk_button_set_focus_on_click (GTK_BUTTON (combo_box->priv->button),
+                                      focus_on_click);
       
-      g_object_notify (G_OBJECT (combo), "focus-on-click");
+      g_object_notify (G_OBJECT (combo_box), "focus-on-click");
     }
 }
 
@@ -5176,11 +5186,11 @@ gtk_combo_box_set_focus_on_click (GtkComboBox *combo,
  * Since: 2.6
  **/
 gboolean
-gtk_combo_box_get_focus_on_click (GtkComboBox *combo)
+gtk_combo_box_get_focus_on_click (GtkComboBox *combo_box)
 {
-  g_return_val_if_fail (GTK_IS_COMBO_BOX (combo), FALSE);
+  g_return_val_if_fail (GTK_IS_COMBO_BOX (combo_box), FALSE);
   
-  return combo->priv->focus_on_click;
+  return combo_box->priv->focus_on_click;
 }